﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Utility
{
    public class MyCommon
    {
        public static int ConvertToInt(object str)
        {
            int rst = 0;
            if (str != null && int.TryParse(str.ToString(), out rst))
            {
                return rst;
            }
            return 0;
        }

        public static string ConvertToString(object obj)
        {
            if (obj != null)
            {
                return obj.ToString();
            }
            return "";
        }
    }
}
